#include <cstdio>
#include <cstdlib>
using namespace std;

#define ARRAY_LENGTH 100

void print_array(int[], int);
void swap_element(int[], int, int);
void quick_sort(int[], int);

int main()
{
    int num;
    int array[ARRAY_LENGTH] = {0};
    while (scanf("%d", &num) != EOF) {
        for (int i = 0; i < num; i++) {
            scanf(" %d", &array[i]);
        }
        quick_sort(array, num);
        print_array(array, num);
    }
}

void swap_element(int array[], int i, int j) 
{
    int temp;
    temp = array[i];
    array[i] = array[j];
    array[j] = temp;
}

void quick_sort(int array[], int num) 
{
    int i, last = 0;
    if (num <= 1)
        return;
    swap_element(array, 0, rand() % num);
    for (i = 1; i < num; i++) {
        if (array[i] < array[0])
            swap_element(array, ++last, i);
    }

    swap_element(array, 0, last);
    quick_sort(array, last);
    quick_sort(array + last + 1, num - last - 1);
}

void print_array(int array[], int num) 
{
    for (int i = 0; i < num; i++) {
        if (i != num - 1)
            printf("%d ", array[i]);
        else
            printf("%d", array[i]);
    }
    printf("\n");
}